package info.yangguo.service;

import info.yangguo.util.HexUtil;
import info.yangguo.util.Transfer;

/**
 * @author:杨果
 * @date:2016/10/12 下午1:52
 *
 * Description:
 *
 */
public class Decode {
    public static Object[] decode(byte[] bytes) {
        Object[] result = new Object[5];
        String hexStr = HexUtil.encodeHexStr(bytes, false);
        String tmp1 = Transfer.decodeIdentifier(hexStr);
        if (tmp1.startsWith("FF")) {
            return DecodeResponse.decode(tmp1);
        } else {
            return DecodeRequest.decode(tmp1);
        }
    }
}
